package com.sfeir.client.service;

import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.sfeir.shared.Level;

/**
 * 
 * @author Oussama Zoghlami
 * @date 27/12/2011
 * 
 */
@RemoteServiceRelativePath("appService")
public interface AppService extends RemoteService {

	/**
	 * Method allowing to get all the game levels
	 * 
	 * @return
	 */
	public List<Level> getLevels();

	/**
	 * Method allowing to return the levels and the authenticated user score
	 * associated to each level
	 * 
	 * @return
	 */
	public List<Map<String, Object>> getUserLevels();

	/**
	 * Method allowing to save the score associated to a given level.
	 * 
	 * @param levelOrder
	 * @param score
	 * @return number of stars associated to the score
	 */
	public int saveScore(int levelOrder, int score);

	/**
	 * Method allowing to return the next to beat person
	 * 
	 * @return
	 */
	public List<Map<String, Object>> getNextToBeat(int level);

	/**
	 * retrieve the nickname of the connected user
	 * 
	 * @return the nickname of the connected user
	 */
	public String getNickname();

	/**
	 * Method allowing to disconnect the authenticated user and get the logout
	 * url
	 * 
	 * @return Logout URL
	 */
	public String getLogoutUrl();
}
